/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.insta.controller;

import com.insta.Counter;

import org.json.JSONObject;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author ARNAUD
 */
public class AddAction extends HttpServlet {

   	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public AddAction() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
                 Counter count = Counter.getInstance();
                 count.add(1);
               response.sendRedirect("./index");
              
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		this.doGet(request, response);
	}
        
        


	
}
